/**
 * @Author: Lenovo
 * @Date: 2024/5/15 14:37
 * @description:
 */
public class Date {
    public int year;
    public int month;
    public int day;
    public Date(int year,int month,int day){
        this.year=year;
        this.month=month;
        this.day=day;
    }

    /*public Date(){
        //没有构造方法，编译器自己创建的
    }*/
    //无参的代构造方法
    public Date(){
        /*this.year=2000;
        this.month=5;
        this.day=4;*/
        this(2000,5,4);
        System.out.println("没有参数的构造方法...");
    }
    /*public void setDate(int y,int m,int d){
        year=y;
        month=m;
        day=d;
    }*/
    public void setDate(Date this,int year,int month,int day){
        this.year=year;
        this.month=month;
        this.day=day;
        /*this.PrintDate();*/
    }
    public void PrintDate(){
        System.out.println(this.year+" 年 "+this.month+ " 月 "+this.day+ " 日 ");
    }

    public static void main(String[] args) {
        Date date=new Date(2000,1,1);
        date.PrintDate();
        Date date1=new Date();
        //date1.setDate(2000,4,1);
        date1.PrintDate();

    }
    public static void main2(String[] args) {
        /*Date date=new Date();//类的实例化
        date.setDate(1900,2,3);*/
        /*date.PrintDate();
    }
    public static void main1(String[] args) {
        //等会用于测试
        Date date=new Date();
        date.setDate(1900,2,3);
        /*date.PrintDate();

        Date date2=new Date();
        date2.setDate(2000,5,1);
        date2.PrintDate();

        Date date3=new Date();
        date3.setDate(2024,5,15);
        date3.PrintDate();*/
    }
}
